package com.alit.face.koala.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import com.alit.face.koala.entity.KoalaHistoryCallback;
import com.alit.face.koala.repository.KoalaHistoryCallbackRespository;
import com.alit.face.koala.service.HistoryKoalaCallbackService;

/**
 * @author litong
 * @date 2019年6月13日_下午9:05:20
 * @version 1.0
 * @desc
 */
@Service
public class HistoryKoalaCallbackServiceImpl implements HistoryKoalaCallbackService {

  @Autowired
  private KoalaHistoryCallbackRespository hkcr;

  @Override
  public Page<KoalaHistoryCallback> paginate(int page, int rows) {
    @SuppressWarnings("deprecation")
    PageRequest pageRequest = new PageRequest(page - 1, rows);
    Page<KoalaHistoryCallback> findAll = hkcr.findAll(pageRequest);
    return findAll;
  }
  }
